Drop assert in zmalloc and raise runtime error
authorStefano Babic <sbabic@denx.de>
Tue, 17 Aug 2021 11:21:43 +0000 (13:21 +0200)
committerStefano Babic <sbabic@denx.de>
Tue, 31 Aug 2021 12:59:23 +0000 (14:59 +0200)
commite91e6383bf287cd522466cd06096865950048f15
tree86c774b9a0e20274bfa8dacdfcfc32c0e4379151
parentb5f05ba6b58606f1da39c562fb33754992f7f937
Drop assert in zmalloc and raise runtime error

Most assert in code are useful because they signal a real bug. However,
if allocation on the heap fails, it is a runtime error because system
gets rid of memory. This is more important on embedded systems,
and the caller process cannot exit but it should be informed with return
code and it will decide how to work on.

This drop the assert clause and add error code handling when zmalloc is
called.

Signed-off-by: Stefano Babic <sbabic@denx.de>
13 files changed:
src/lib/comp/comp.c
src/lib/comp/nocomp/nocomp.c
src/lib/comp/zstd/zstd.c
src/lib/dl/dl.c
src/lib/dl/multipart.c
src/lib/dl/range.c
src/lib/error.c
src/lib/hash/hash.c
src/lib/header.c
src/lib/index/index_create.c
src/lib/index/index_read.c
src/lib/io.c
src/lib/zck.c